<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//Ddiv HTML 4.01 divansitional//EN" "http://www.w3.org/div/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-81">
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/goals.css" rel="stylesheet">
  <title>人马君</title>
</head>
  <body>
    <div class="page-group">
      <div class="page page-current">
        <header class="bar bar-nav fs-header-small">
          <c:choose>
            <c:when test="${not empty scheduleId or back eq 'student'}">
              <a href="${ctx.host}/students/${courseRound.student.id}/rounds/${courseRound.id}${not empty scheduleId ? '?scheduleId=' : ''}${scheduleId}" class="icon icon-left pull-left"></a>
            </c:when>
            <c:otherwise>
              <a href="${ctx.host}/rounds/${courseRound.id}?type=${courseRound.roundCoursewareStatus}" class="icon icon-left pull-left"></a>
            </c:otherwise>
          </c:choose>
          <h1 class="title" style="font-weight: bold;">${weeks}周成果报告</h1>
        </header>
        <div class="content">
          <div class="content-block no-margin text-center" style="padding: .25rem .75rem; background: #ffde00;">
            <img src="${ctx.resource}/image/medal.png" style="display: block; margin: 0 auto; width: 2.5rem;">
            <p style="margin: .25rem 0 0; font-size: .7rem;">以下是您在人马君所获得的成果</p>
          </div>
        
          <div class="content-block basic-table" style="padding: 0; margin: 0">
            <!-- <div class="basic-item flex-box basic-header">
              <div class="item flex-shrink"></div>
              <div class="item">体重(KG)</div>
              <div class="item">体脂率(%)</div>
              <div class="item">胸围(CM)</div>
              <div class="item">腰围(CM)</div>
              <div class="item">臀围(CM)</div>
              <c:if test="${edit}">
                <div class="item"></div>
              </c:if>
            </div>
            <c:forEach begin="0" end="${weeks}" var="i">
              <c:set var="week" value="${i}${''}"></c:set>
              <div class="basic-item flex-box">
              <div class="flex-shrink">
                <c:choose>
                  <c:when test="${i eq 0}">入营前</c:when>
                  <c:otherwise>第${i}周</c:otherwise>
                </c:choose>
              </div>
              <div class="item"><span class="big-size"><fmt:formatNumber value='${bwhRecords[i].weight}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></span></div>
              <div class="item"><span class="big-size"><fmt:formatNumber value='${bwhRecords[i].bodyFatRate}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></span></div>
              <div class="item"><span class="big-size"><fmt:formatNumber value='${bwhRecords[i].bust}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></span></div>
              <div class="item"><span class="big-size"><fmt:formatNumber value='${bwhRecords[i].waist}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></span></div>
              <div class="item"><span class="big-size"><fmt:formatNumber value='${bwhRecords[i].hips}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></span></div>
              <c:if test="${edit}">
                <a class="item" href="${ctx.host}/rounds/${courseRound.id}/result-report/edit-bwh?week=${i}&scheduleId=${scheduleId}" style="color: #c1c1c1;"><span class="icon icon-right"></span></a>
              </c:if>
            </div>
            </c:forEach> -->
          </div>
          
          <div class="basic-title text-center" style="position: relative; padding: .5rem 0;font-size: .85rem;background: #ffde00;">${weeks}周的改变如下
            <c:if test="${edit}">
              <a class="pull-right" href="${ctx.host}/rounds/${courseRound.id}/result-report/edit-change<c:choose><c:when test='${not empty scheduleId}'>?scheduleId=${scheduleId}</c:when><c:otherwise><c:if test='${not empty back}'>?back=${back}</c:if></c:otherwise></c:choose>" style="position: absolute; right: .75rem; font-size: .75rem;">编辑</a>
            </c:if>
          </div>
          <table class="change-table">
            <tbody>
              <tr>
                <td rowspan="3" class="change-table-left" style="background: #eeeeee;">基础力量</td>
                <td>静蹲</td>
                <td>${basicData.staticSquat.staticSquat}</td>
                <td>${resultReport.staticSquat.staticSquat}</td>
                <td rowspan="3" class="change-table-right" style="background: #eeeeee;"><strong>后续计划</strong><br>${resultReport.basicForcePlan}<!-- <a href="" class="detail-link">详情</a> --></td>
              </tr>
              <tr>
                <td>俯卧撑(30s)</td>
                <td>${basicData.pushUp.pushUp}</td>
                <td>${resultReport.pushUp.pushUp}</td>
              </tr>
              <tr>
                <td>两头起(30s)</td>
                <td>${basicData.vUp.vUp}</td>
                <td>${resultReport.vUp.vUp}</td>
              </tr>
            </tbody>
          </table>
          <table class="change-table">
            <tbody>
              <tr>
                <td class="change-table-left" rowspan="2" style="background: #fff190;">心肺测试</td>
                <td>1分钟波比跳</td>
                <td>${empty basicData.standardBobi ? '' : (basicData.standardBobi ? '标准，' : '简化，')}${basicData.bobi}${empty basicData.bobi ? '' : '个'}</td>
                <td>${empty resultReport.standardBobi ? '' : (resultReport.standardBobi ? '标准，' : '简化，')}${resultReport.bobi}${empty resultReport.bobi ? '' : '个'}</td>
                <td rowspan="2" class="change-table-right" style="background: #eeeeee;" ><strong>后续计划</strong><br/>${resultReport.heartLungPlan}<!-- <a href="" class="detail-link">详情</a> -->
                </td>
              </tr>
              <tr>
                <td>其他</td>
                <td class="change-table-right"><!-- <a href="" class="detail-link">详情</a> --></td>
                <td class="change-table-right">${resultReport.heartLungRemark}<!-- <a href="" class="detail-link">详情</a> --></td>
              </tr>
            </tbody>
          </table>
          <table class="change-table">
            <tbody>
              <tr>
                <td class="change-table-left" style="background: #eeeeee;">其他</td>
                <td></td>
                <td class="change-table-right">${basicData.remark}<!-- <a href="" class="detail-link">详情</a> --></td>
                <td class="change-table-right">${resultReport.remark}<!-- <a href="" class="detail-link">详情</a> --></td>
                <td class="change-table-right" style="background: #eeeeee;"><strong>后续计划</strong><br/>${resultReport.otherPlan}<!-- <a href="" class="detail-link">详情</a> --></td>
              </tr>
            </tbody>
          </table>
   
          
          <div class="basic-title text-center" style="position: relative; padding: .5rem 0;font-size: .85rem;background: #ffde00;">对本周期的总结
            <c:if test="${edit}">
              <a class="pull-right" href="${ctx.host}/rounds/${courseRound.id}/result-report/edit-summary<c:choose><c:when test='${not empty scheduleId}'>?scheduleId=${scheduleId}</c:when><c:otherwise><c:if test='${not empty back}'>?back=${back}</c:if></c:otherwise></c:choose>" style="position: absolute; right: .75rem; font-size: .75rem;">编辑</a>
            </c:if>
          </div>
          <form>
            <div class="row no-gutter summary-grid">
              <div class="col-50 summary-item">
                <p class="summary-title">学员</p>
                <div class="description">
                  <p>${resultReport.studentSummary}</p>
                </div>
                <!-- <c:if test="${not empty resultReport.studentSummary}"><a href="javascript:void(0);" class="detail-link">展开</a></c:if> -->
              </div>
              <div class="col-50 summary-item">
                <p class="summary-title">教练</p>
                <div class="description">
                  <p>${resultReport.coachSummary}</p>
                </div>
                <!-- <c:if test="${not empty resultReport.coachSummary}"><a href="javascript:void(0);" class="detail-link">展开</a></c:if> -->
              </div>
              <div class="col-50 summary-item">
                <p class="summary-title">对教练想说的话</p>
                <div class="description">
                  <p>${resultReport.wordsToCoach}</p>
                </div>
                <!-- <c:if test="${not empty resultReport.wordsToCoach}"><a href="javascript:void(0);" class="detail-link">展开</a></c:if> -->
              </div>
              <div class="col-50 summary-item">
                <p class="summary-title">对学员想说的话</p>
                <div class="description">
                  <p>${resultReport.wordsToStudent}</p>
                </div>
              </div>
            </div>
          </form>
          
          <c:if test="${edit || not empty resultReport.previousPicture || not empty resultReport.latterPicture}">
            <div class="basic-title text-center" style="position: relative; padding: .5rem 0;font-size: .85rem;background: #ffde00;">对比照</div>
            <div class="row no-gutter summary-grid" 
              style="overflow: auto; display: -webkit-box; display: flex;">
              <div class="col-50 summary-item before" style="height: auto; display: flex; display: -webkit-box; align-items: center;">
                <p class="summary-title" style="position: absolute; left: 0; right: 0; top: .5rem;">入营时</p>
                <div class="contrast-photo${empty resultReport.previousPicture && edit ? ' upload-image' : ''}" <c:if test="${not empty resultReport.previousPicture and edit}">style="margin-bottom: 1.5rem;"</c:if>>
                  <c:choose>
                    <c:when test="${empty resultReport.previousPicture}">
                      <c:if test="${edit}">
                        <img alt="点此上传入营时照片" src="${ctx.resource}/image/add-picture.png" width="50%" height="auto">
                      </c:if>
                    </c:when>
                    <c:otherwise>
                      <img alt="入营时照片" src="${cloud.prod}/${resultReport.previousPicture}" width="100%" height="auto">
                    </c:otherwise>
                  </c:choose>
                </div>
                
                <a href="javascript:void(0);" class="align-update button before-update ${!(not empty resultReport.previousPicture and edit) ? 'hide' : ''}"><span class="icon icon-refresh"></span>&nbsp;&nbsp;重新上传</a>
              </div>
              
              <div class="col-50 summary-item after" style="height: auto; display: flex; display: -webkit-box; align-items: center;">
                <p class="summary-title" style="position: absolute; left: 0; right: 0; top: .5rem;">结营时</p>
                <div class="contrast-photo${empty resultReport.latterPicture && edit ? ' upload-image' : ''}" <c:if test="${not empty resultReport.latterPicture and edit}">style="margin-bottom: 1.5rem;"</c:if>>
                  <c:choose>
                    <c:when test="${empty resultReport.latterPicture}">
                      <c:if test="${edit}">
                        <img alt="点此上传结营时照片" src="${ctx.resource}/image/add-picture.png" width="50%" height="auto">
                      </c:if>
                    </c:when>
                    <c:otherwise>
                      <img alt="结营时照片" src="${cloud.prod}/${resultReport.latterPicture}" width="100%" height="auto">
                    </c:otherwise>
                  </c:choose>
                </div>
                
                <a href="javascript:void(0);" class="align-update button after-update ${!(not empty resultReport.latterPicture and edit) ? 'hide' : ''}"><span class="icon icon-refresh"></span>&nbsp;&nbsp;重新上传</a>
              </div>
            </div>
          </c:if>
        </div>
      </div>
    </div>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/result/result.js" />
  <script type="text/javascript">
    var jsConfig = JSON.parse('${wechatJsConfig}')
    require(['page/result/result'], function(page) {
      page.init({
        jsConfig: jsConfig,
        roundId: '${courseRound.id}',
        imgUrl: '${cloud.prod}'
      })
    })
  </script>
  
  </body>
</html>
